/*
 * @ author Junr
 * @ use 用户相关
 */
import Request from '../request';
export default {
  // 登录
  login (params) {
    return Request.post({ url: `/login`, params });
  },
  // 发送短信
  sendMsg (params) {
    return Request.post({ url: `/sms/send/` + params.type, params });
  },
  // 获取用户信息
  getUserInfo (params) {
    return Request.post({ url: `/m/user/info`, params });
  },
  // 修改头像
  setAvatar (params) {
    return Request.post({ url: `/m/alter/head`, params });
  },
  // 注册
  register (params) {
    return Request.post({ url: `/reg`, params });
  },
  // 修改密码
  updatePass (params) {
    return Request.post({ url: `/update-pass`, params });
  },
  // 账户信息
  accountInfo (params) {
    return Request.post({ url: `/m/account/info`, params });
  },
  // 获取优惠劵活动列表
  couponActivity (params) {
    return Request.post({ url: `/coupon/activity/list`, params });
  },
  // 获取优惠劵列表
  coupon (params) {
    return Request.post({ url: `/m/coupon/my`, params });
  },
  // 领取优惠劵
  collectCoupon (params) {
    return Request.post({ url: `/m//coupon/collect`, params });
  },
  // 收货地址
  address (params, url) {
    return Request.post({ url: `/m/address/${url}`, params });
  },
  // 订单列表(广告订单&积分订单&订单详情)
  order (params, url) {
    return Request.post({ url: `/m/order/${url}`, params });
  },
  // 帐户管理
  account (params, url) {
    return Request.post({ url: `/m/account/${url}`, params });
  },
  // 意见反馈
  feedback (params) {
    return Request.post({ url: `m/feedback`, params });
  },
  // 历史搜索记录
  getHistory (params) {
    return Request.post({ url: `/m/search/history`, params });
  }
};
